-
Notifications
You must be signed in to change notification settings - Fork 1.4k
CA2241 Provide correct arguments to formatting methods #7190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| UncPattern.IsMatch(winDirectory).ShouldBe(false); | ||
| UncPattern.IsMatch(unixDirectory).ShouldBe(false); | ||
| UncPattern.IsMatch(string.Empty).ShouldBe(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at all these tests, they don't really feel substantively different from each other, and many check the same thing twice. Maybe condense into one test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are those changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Forgind I disagree pretty strongly with this recommendation, because it violates the test principle that a test should fail for only one reason. Here the new test could fail if one of the implementations fails but it wouldn't be super clear from the failure which one.
@elachlan don't bother reverting though; this isn't a huge deal and you already did the unification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair. I was borderline on suggesting just removing the legacy tests entirely—they test Regex, which isn't even in MSBuild. FileUtilitiesRegex.IsUncPattern and FileUtilitiesRegex.StartsWithUncPattern both just call FileUtilitiesRegex.StartsWithUncPatternMatchLength, so it all felt like one test to me. It's possible that won't be true in the future, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Up to the team, I don't mind either way. Just let me know what you want me to do. If there isn't any changes then is this okay to merge?
Forgind
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks about right to me 🙂
|
|
||
| UncPattern.IsMatch(winDirectory).ShouldBe(false); | ||
| UncPattern.IsMatch(unixDirectory).ShouldBe(false); | ||
| UncPattern.IsMatch(string.Empty).ShouldBe(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Forgind I disagree pretty strongly with this recommendation, because it violates the test principle that a test should fail for only one reason. Here the new test could fail if one of the implementations fails but it wouldn't be super clear from the failure which one.
@elachlan don't bother reverting though; this isn't a huge deal and you already did the unification.
Relates to #7174